package org.brakepedal.server.support.bluetooth;

import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.ObjectProvider;

/**
 * Date: 2024/4/1 13:50
 *
 * @author Huanyu Mark
 */
public interface MultiArgsObjectProvider<T> extends ObjectProvider<T> {
    Object[] noArgs = new Object[]{};

    @Override
    default T getIfAvailable() throws BeansException {
        throw new BeanCreationException("Unsupported create method");
    }

    @Override
    default T getIfUnique() throws BeansException {
        throw new BeanCreationException("Unsupported create method");
    }

    @Override
    default @NotNull T getObject() throws BeansException {
        return getObject(noArgs);
    }
}
